import {defineConfig} from "vite";
import viteAliases from './plugins/viteAliases'
import changeHtml from './plugins/changeHtml'
import configureServer from './plugins/configureServer'

export default defineConfig({
    optimizeDeps: {
        exclude: ['lodash-es'],//lodash-es库不进行代码预构建； 会发起请求每一个内容import/export;
    },
    build: {
        minify: false,
        //rollupOptions 的配置
        rollupOptions: {
            output: {
                // 将 node_modules 里面的包进行分包
                manualChunks: (id => {
                    if (id.includes("node_modules")) {
                        return "vendor"
                    }
                })
            }
        }

    },
    plugins: [
        viteAliases(),
        changeHtml("首页"),
        configureServer(),
    ],
})



